﻿namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class AddressRepository:BaseManagerContext,IAddressRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~AddressRepository()
    		{
    		 Dispose(false);
    		}
    		public AddressRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct AddressRelatedEntities
            {
                			   
    			      public string Bank { get { return "Bank"; } }
    			  			   
    			      public string Customer { get { return "Customer"; } }
    			  			   
    			      public string SalesPerson { get { return "SalesPerson"; } }
    			  			   
    			      public string Suppliers { get { return "Suppliers"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Address GetAddressWithAllChilds(int AddressID) 
            {
    				try
    		{
    		return context.Address.Include("Bank").Include("Customer").Include("SalesPerson").Include("Suppliers").SingleOrDefault(x=>x.AddressID == AddressID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Address GetAddress(int AddressID) 
            {
    		try
    		{
    		return context.Address.SingleOrDefault(x=>x.AddressID == AddressID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Address> GetAll()
            {
    		try
    		{
                return context.Address.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Address GetByID(int id)
            {
    		try
    		{
                return context.Address.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Address Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Address.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Address _Address = context.Address.Find(id);
                context.Address.Remove(_Address);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Address Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Address Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Address GetAddressWithBank(int AddressID) 
    				{
    				try
    				{
    				return context.Address.Include("Bank").SingleOrDefault(x=>x.AddressID == AddressID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Address GetAddressWithCustomer(int AddressID) 
    				{
    				try
    				{
    				return context.Address.Include("Customer").SingleOrDefault(x=>x.AddressID == AddressID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Address GetAddressWithSalesPerson(int AddressID) 
    				{
    				try
    				{
    				return context.Address.Include("SalesPerson").SingleOrDefault(x=>x.AddressID == AddressID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Address GetAddressWithSuppliers(int AddressID) 
    				{
    				try
    				{
    				return context.Address.Include("Suppliers").SingleOrDefault(x=>x.AddressID == AddressID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class BankRepository:BaseManagerContext,IBankRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~BankRepository()
    		{
    		 Dispose(false);
    		}
    		public BankRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct BankRelatedEntities
            {
                			   
    			      public string City { get { return "City"; } }
    			  			   
    			      public string BankAccounts { get { return "BankAccounts"; } }
    			  			   
    			      public string Address { get { return "Address"; } }
    			  			   
    			      public string Email { get { return "Email"; } }
    			  			   
    			      public string Phones { get { return "Phones"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Bank GetBankWithAllChilds(int BankID) 
            {
    				try
    		{
    		return context.Bank.Include("City").Include("BankAccounts").Include("Address").Include("Email").Include("Phones").SingleOrDefault(x=>x.BankID == BankID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Bank GetBank(int BankID) 
            {
    		try
    		{
    		return context.Bank.SingleOrDefault(x=>x.BankID == BankID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Bank> GetAll()
            {
    		try
    		{
                return context.Bank.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Bank GetByID(int id)
            {
    		try
    		{
                return context.Bank.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Bank Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Bank.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Bank _Bank = context.Bank.Find(id);
                context.Bank.Remove(_Bank);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Bank Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Bank Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Bank GetBankWithCity(int BankID) 
    				{
    				try
    				{
    				return context.Bank.Include("City").SingleOrDefault(x=>x.BankID == BankID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Bank GetBankWithBankAccounts(int BankID) 
    				{
    				try
    				{
    				return context.Bank.Include("BankAccounts").SingleOrDefault(x=>x.BankID == BankID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Bank GetBankWithAddress(int BankID) 
    				{
    				try
    				{
    				return context.Bank.Include("Address").SingleOrDefault(x=>x.BankID == BankID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Bank GetBankWithEmail(int BankID) 
    				{
    				try
    				{
    				return context.Bank.Include("Email").SingleOrDefault(x=>x.BankID == BankID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Bank GetBankWithPhones(int BankID) 
    				{
    				try
    				{
    				return context.Bank.Include("Phones").SingleOrDefault(x=>x.BankID == BankID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class BankAccountsRepository:BaseManagerContext,IBankAccountsRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~BankAccountsRepository()
    		{
    		 Dispose(false);
    		}
    		public BankAccountsRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct BankAccountsRelatedEntities
            {
                			   
    			      public string Bank { get { return "Bank"; } }
    			  			   
    			      public string Checks { get { return "Checks"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.BankAccounts GetBankAccountsWithAllChilds(int BankAccountsID) 
            {
    				try
    		{
    		return context.BankAccounts.Include("Bank").Include("Checks").SingleOrDefault(x=>x.BankAccountsID == BankAccountsID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.BankAccounts GetBankAccounts(int BankAccountsID) 
            {
    		try
    		{
    		return context.BankAccounts.SingleOrDefault(x=>x.BankAccountsID == BankAccountsID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<BankAccounts> GetAll()
            {
    		try
    		{
                return context.BankAccounts.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public BankAccounts GetByID(int id)
            {
    		try
    		{
                return context.BankAccounts.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(BankAccounts Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.BankAccounts.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                BankAccounts _BankAccounts = context.BankAccounts.Find(id);
                context.BankAccounts.Remove(_BankAccounts);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                BankAccounts Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(BankAccounts Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.BankAccounts GetBankAccountsWithBank(int BankAccountsID) 
    				{
    				try
    				{
    				return context.BankAccounts.Include("Bank").SingleOrDefault(x=>x.BankAccountsID == BankAccountsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.BankAccounts GetBankAccountsWithChecks(int BankAccountsID) 
    				{
    				try
    				{
    				return context.BankAccounts.Include("Checks").SingleOrDefault(x=>x.BankAccountsID == BankAccountsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class BuyPriceListRepository:BaseManagerContext,IBuyPriceListRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~BuyPriceListRepository()
    		{
    		 Dispose(false);
    		}
    		public BuyPriceListRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct BuyPriceListRelatedEntities
            {
                			   
    			      public string Suppliers { get { return "Suppliers"; } }
    			  			   
    			      public string BuyPriceListDetails { get { return "BuyPriceListDetails"; } }
    			  			   
    			      public string Suppliers1 { get { return "Suppliers1"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.BuyPriceList GetBuyPriceListWithAllChilds(int BuyPriceListID) 
            {
    				try
    		{
    		return context.BuyPriceList.Include("Suppliers").Include("BuyPriceListDetails").Include("Suppliers1").SingleOrDefault(x=>x.BuyPriceListID == BuyPriceListID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.BuyPriceList GetBuyPriceList(int BuyPriceListID) 
            {
    		try
    		{
    		return context.BuyPriceList.SingleOrDefault(x=>x.BuyPriceListID == BuyPriceListID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<BuyPriceList> GetAll()
            {
    		try
    		{
                return context.BuyPriceList.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public BuyPriceList GetByID(int id)
            {
    		try
    		{
                return context.BuyPriceList.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(BuyPriceList Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.BuyPriceList.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                BuyPriceList _BuyPriceList = context.BuyPriceList.Find(id);
                context.BuyPriceList.Remove(_BuyPriceList);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                BuyPriceList Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(BuyPriceList Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.BuyPriceList GetBuyPriceListWithSuppliers(int BuyPriceListID) 
    				{
    				try
    				{
    				return context.BuyPriceList.Include("Suppliers").SingleOrDefault(x=>x.BuyPriceListID == BuyPriceListID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.BuyPriceList GetBuyPriceListWithBuyPriceListDetails(int BuyPriceListID) 
    				{
    				try
    				{
    				return context.BuyPriceList.Include("BuyPriceListDetails").SingleOrDefault(x=>x.BuyPriceListID == BuyPriceListID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.BuyPriceList GetBuyPriceListWithSuppliers1(int BuyPriceListID) 
    				{
    				try
    				{
    				return context.BuyPriceList.Include("Suppliers1").SingleOrDefault(x=>x.BuyPriceListID == BuyPriceListID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class BuyPriceListDetailsRepository:BaseManagerContext,IBuyPriceListDetailsRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~BuyPriceListDetailsRepository()
    		{
    		 Dispose(false);
    		}
    		public BuyPriceListDetailsRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct BuyPriceListDetailsRelatedEntities
            {
                			   
    			      public string BuyPriceList { get { return "BuyPriceList"; } }
    			  			   
    			      public string Products { get { return "Products"; } }
    			  			   
    			      public string Tax { get { return "Tax"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.BuyPriceListDetails GetBuyPriceListDetailsWithAllChilds(int BuyPriceListDetailsID) 
            {
    				try
    		{
    		return context.BuyPriceListDetails.Include("BuyPriceList").Include("Products").Include("Tax").SingleOrDefault(x=>x.BuyPriceListDetailsID == BuyPriceListDetailsID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.BuyPriceListDetails GetBuyPriceListDetails(int BuyPriceListDetailsID) 
            {
    		try
    		{
    		return context.BuyPriceListDetails.SingleOrDefault(x=>x.BuyPriceListDetailsID == BuyPriceListDetailsID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<BuyPriceListDetails> GetAll()
            {
    		try
    		{
                return context.BuyPriceListDetails.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public BuyPriceListDetails GetByID(int id)
            {
    		try
    		{
                return context.BuyPriceListDetails.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(BuyPriceListDetails Obj)
            {		
    		try
    		{
    			
                context.BuyPriceListDetails.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                BuyPriceListDetails _BuyPriceListDetails = context.BuyPriceListDetails.Find(id);
                context.BuyPriceListDetails.Remove(_BuyPriceListDetails);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    				public void DeleteLogical(int id)
            {
              throw new NotImplementedException("La entidad carece de la propiedad ENABLE. No se puede implementar el borrado logico");
            }
    			
            public void Update(BuyPriceListDetails Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.BuyPriceListDetails GetBuyPriceListDetailsWithBuyPriceList(int BuyPriceListDetailsID) 
    				{
    				try
    				{
    				return context.BuyPriceListDetails.Include("BuyPriceList").SingleOrDefault(x=>x.BuyPriceListDetailsID == BuyPriceListDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.BuyPriceListDetails GetBuyPriceListDetailsWithProducts(int BuyPriceListDetailsID) 
    				{
    				try
    				{
    				return context.BuyPriceListDetails.Include("Products").SingleOrDefault(x=>x.BuyPriceListDetailsID == BuyPriceListDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.BuyPriceListDetails GetBuyPriceListDetailsWithTax(int BuyPriceListDetailsID) 
    				{
    				try
    				{
    				return context.BuyPriceListDetails.Include("Tax").SingleOrDefault(x=>x.BuyPriceListDetailsID == BuyPriceListDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class ChecksRepository:BaseManagerContext,IChecksRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~ChecksRepository()
    		{
    		 Dispose(false);
    		}
    		public ChecksRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct ChecksRelatedEntities
            {
                			   
    			      public string BankAccounts { get { return "BankAccounts"; } }
    			  			   
    			      public string GeneralPaymentSupplier { get { return "GeneralPaymentSupplier"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Checks GetChecksWithAllChilds(int CheckID) 
            {
    				try
    		{
    		return context.Checks.Include("BankAccounts").Include("GeneralPaymentSupplier").SingleOrDefault(x=>x.CheckID == CheckID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Checks GetChecks(int CheckID) 
            {
    		try
    		{
    		return context.Checks.SingleOrDefault(x=>x.CheckID == CheckID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Checks> GetAll()
            {
    		try
    		{
                return context.Checks.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Checks GetByID(int id)
            {
    		try
    		{
                return context.Checks.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Checks Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Checks.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Checks _Checks = context.Checks.Find(id);
                context.Checks.Remove(_Checks);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Checks Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Checks Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Checks GetChecksWithBankAccounts(int CheckID) 
    				{
    				try
    				{
    				return context.Checks.Include("BankAccounts").SingleOrDefault(x=>x.CheckID == CheckID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Checks GetChecksWithGeneralPaymentSupplier(int CheckID) 
    				{
    				try
    				{
    				return context.Checks.Include("GeneralPaymentSupplier").SingleOrDefault(x=>x.CheckID == CheckID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class CityRepository:BaseManagerContext,ICityRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~CityRepository()
    		{
    		 Dispose(false);
    		}
    		public CityRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct CityRelatedEntities
            {
                			   
    			      public string Bank { get { return "Bank"; } }
    			  			   
    			      public string Province { get { return "Province"; } }
    			  			   
    			      public string Customer { get { return "Customer"; } }
    			  			   
    			      public string SalesPerson { get { return "SalesPerson"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.City GetCityWithAllChilds(int CityID) 
            {
    				try
    		{
    		return context.City.Include("Bank").Include("Province").Include("Customer").Include("SalesPerson").SingleOrDefault(x=>x.CityID == CityID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.City GetCity(int CityID) 
            {
    		try
    		{
    		return context.City.SingleOrDefault(x=>x.CityID == CityID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<City> GetAll()
            {
    		try
    		{
                return context.City.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public City GetByID(int id)
            {
    		try
    		{
                return context.City.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(City Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.City.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                City _City = context.City.Find(id);
                context.City.Remove(_City);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                City Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(City Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.City GetCityWithBank(int CityID) 
    				{
    				try
    				{
    				return context.City.Include("Bank").SingleOrDefault(x=>x.CityID == CityID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.City GetCityWithProvince(int CityID) 
    				{
    				try
    				{
    				return context.City.Include("Province").SingleOrDefault(x=>x.CityID == CityID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.City GetCityWithCustomer(int CityID) 
    				{
    				try
    				{
    				return context.City.Include("Customer").SingleOrDefault(x=>x.CityID == CityID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.City GetCityWithSalesPerson(int CityID) 
    				{
    				try
    				{
    				return context.City.Include("SalesPerson").SingleOrDefault(x=>x.CityID == CityID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class CountryRepository:BaseManagerContext,ICountryRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~CountryRepository()
    		{
    		 Dispose(false);
    		}
    		public CountryRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct CountryRelatedEntities
            {
                			   
    			      public string Province { get { return "Province"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Country GetCountryWithAllChilds(int CountryID) 
            {
    				try
    		{
    		return context.Country.Include("Province").SingleOrDefault(x=>x.CountryID == CountryID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Country GetCountry(int CountryID) 
            {
    		try
    		{
    		return context.Country.SingleOrDefault(x=>x.CountryID == CountryID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Country> GetAll()
            {
    		try
    		{
                return context.Country.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Country GetByID(int id)
            {
    		try
    		{
                return context.Country.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Country Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Country.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Country _Country = context.Country.Find(id);
                context.Country.Remove(_Country);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Country Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Country Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Country GetCountryWithProvince(int CountryID) 
    				{
    				try
    				{
    				return context.Country.Include("Province").SingleOrDefault(x=>x.CountryID == CountryID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class CurrencyRepository:BaseManagerContext,ICurrencyRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~CurrencyRepository()
    		{
    		 Dispose(false);
    		}
    		public CurrencyRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct CurrencyRelatedEntities
            {
                			   
    			      public string CurrencyConversion { get { return "CurrencyConversion"; } }
    			  			   
    			      public string CurrencyConversion1 { get { return "CurrencyConversion1"; } }
    			  			   
    			      public string PaymentMethod { get { return "PaymentMethod"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Currency GetCurrencyWithAllChilds(int CurrencyID) 
            {
    				try
    		{
    		return context.Currency.Include("CurrencyConversion").Include("CurrencyConversion1").Include("PaymentMethod").SingleOrDefault(x=>x.CurrencyID == CurrencyID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Currency GetCurrency(int CurrencyID) 
            {
    		try
    		{
    		return context.Currency.SingleOrDefault(x=>x.CurrencyID == CurrencyID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Currency> GetAll()
            {
    		try
    		{
                return context.Currency.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Currency GetByID(int id)
            {
    		try
    		{
                return context.Currency.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Currency Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Currency.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Currency _Currency = context.Currency.Find(id);
                context.Currency.Remove(_Currency);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Currency Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Currency Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Currency GetCurrencyWithCurrencyConversion(int CurrencyID) 
    				{
    				try
    				{
    				return context.Currency.Include("CurrencyConversion").SingleOrDefault(x=>x.CurrencyID == CurrencyID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Currency GetCurrencyWithCurrencyConversion1(int CurrencyID) 
    				{
    				try
    				{
    				return context.Currency.Include("CurrencyConversion1").SingleOrDefault(x=>x.CurrencyID == CurrencyID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Currency GetCurrencyWithPaymentMethod(int CurrencyID) 
    				{
    				try
    				{
    				return context.Currency.Include("PaymentMethod").SingleOrDefault(x=>x.CurrencyID == CurrencyID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class CurrencyConversionRepository:BaseManagerContext,ICurrencyConversionRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~CurrencyConversionRepository()
    		{
    		 Dispose(false);
    		}
    		public CurrencyConversionRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct CurrencyConversionRelatedEntities
            {
                			   
    			      public string Currency { get { return "Currency"; } }
    			  			   
    			      public string Currency1 { get { return "Currency1"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.CurrencyConversion GetCurrencyConversionWithAllChilds(int ConversionID) 
            {
    				try
    		{
    		return context.CurrencyConversion.Include("Currency").Include("Currency1").SingleOrDefault(x=>x.ConversionID == ConversionID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.CurrencyConversion GetCurrencyConversion(int ConversionID) 
            {
    		try
    		{
    		return context.CurrencyConversion.SingleOrDefault(x=>x.ConversionID == ConversionID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<CurrencyConversion> GetAll()
            {
    		try
    		{
                return context.CurrencyConversion.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public CurrencyConversion GetByID(int id)
            {
    		try
    		{
                return context.CurrencyConversion.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(CurrencyConversion Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.CurrencyConversion.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                CurrencyConversion _CurrencyConversion = context.CurrencyConversion.Find(id);
                context.CurrencyConversion.Remove(_CurrencyConversion);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                CurrencyConversion Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(CurrencyConversion Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.CurrencyConversion GetCurrencyConversionWithCurrency(int ConversionID) 
    				{
    				try
    				{
    				return context.CurrencyConversion.Include("Currency").SingleOrDefault(x=>x.ConversionID == ConversionID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.CurrencyConversion GetCurrencyConversionWithCurrency1(int ConversionID) 
    				{
    				try
    				{
    				return context.CurrencyConversion.Include("Currency1").SingleOrDefault(x=>x.ConversionID == ConversionID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class CustomerRepository:BaseManagerContext,ICustomerRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~CustomerRepository()
    		{
    		 Dispose(false);
    		}
    		public CustomerRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct CustomerRelatedEntities
            {
                			   
    			      public string City { get { return "City"; } }
    			  			   
    			      public string PaymentMethod { get { return "PaymentMethod"; } }
    			  			   
    			      public string Sales { get { return "Sales"; } }
    			  			   
    			      public string SalesPriceListByCustomer { get { return "SalesPriceListByCustomer"; } }
    			  			   
    			      public string CustomerType { get { return "CustomerType"; } }
    			  			   
    			      public string SalesPriceList { get { return "SalesPriceList"; } }
    			  			   
    			      public string SalesPerson { get { return "SalesPerson"; } }
    			  			   
    			      public string TaxFigure { get { return "TaxFigure"; } }
    			  			   
    			      public string Address { get { return "Address"; } }
    			  			   
    			      public string Email { get { return "Email"; } }
    			  			   
    			      public string Phones { get { return "Phones"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Customer GetCustomerWithAllChilds(int CustomerID) 
            {
    				try
    		{
    		return context.Customer.Include("City").Include("PaymentMethod").Include("Sales").Include("SalesPriceListByCustomer").Include("CustomerType").Include("SalesPriceList").Include("SalesPerson").Include("TaxFigure").Include("Address").Include("Email").Include("Phones").SingleOrDefault(x=>x.CustomerID == CustomerID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Customer GetCustomer(int CustomerID) 
            {
    		try
    		{
    		return context.Customer.SingleOrDefault(x=>x.CustomerID == CustomerID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Customer> GetAll()
            {
    		try
    		{
                return context.Customer.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Customer GetByID(int id)
            {
    		try
    		{
                return context.Customer.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Customer Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Customer.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Customer _Customer = context.Customer.Find(id);
                context.Customer.Remove(_Customer);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Customer Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Customer Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithCity(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("City").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithPaymentMethod(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("PaymentMethod").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithSales(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("Sales").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithSalesPriceListByCustomer(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("SalesPriceListByCustomer").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithCustomerType(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("CustomerType").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithSalesPriceList(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("SalesPriceList").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithSalesPerson(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("SalesPerson").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithTaxFigure(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("TaxFigure").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithAddress(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("Address").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithEmail(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("Email").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Customer GetCustomerWithPhones(int CustomerID) 
    				{
    				try
    				{
    				return context.Customer.Include("Phones").SingleOrDefault(x=>x.CustomerID == CustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class CustomerTypeRepository:BaseManagerContext,ICustomerTypeRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~CustomerTypeRepository()
    		{
    		 Dispose(false);
    		}
    		public CustomerTypeRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct CustomerTypeRelatedEntities
            {
                			   
    			      public string Customer { get { return "Customer"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.CustomerType GetCustomerTypeWithAllChilds(int CustomerTypeID) 
            {
    				try
    		{
    		return context.CustomerType.Include("Customer").SingleOrDefault(x=>x.CustomerTypeID == CustomerTypeID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.CustomerType GetCustomerType(int CustomerTypeID) 
            {
    		try
    		{
    		return context.CustomerType.SingleOrDefault(x=>x.CustomerTypeID == CustomerTypeID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<CustomerType> GetAll()
            {
    		try
    		{
                return context.CustomerType.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public CustomerType GetByID(int id)
            {
    		try
    		{
                return context.CustomerType.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(CustomerType Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.CustomerType.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                CustomerType _CustomerType = context.CustomerType.Find(id);
                context.CustomerType.Remove(_CustomerType);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                CustomerType Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(CustomerType Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.CustomerType GetCustomerTypeWithCustomer(int CustomerTypeID) 
    				{
    				try
    				{
    				return context.CustomerType.Include("Customer").SingleOrDefault(x=>x.CustomerTypeID == CustomerTypeID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class DailyCashRepository:BaseManagerContext,IDailyCashRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~DailyCashRepository()
    		{
    		 Dispose(false);
    		}
    		public DailyCashRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct DailyCashRelatedEntities
            {
                			   
    			      public string DailyCashDetails { get { return "DailyCashDetails"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.DailyCash GetDailyCashWithAllChilds(int DailyCashID) 
            {
    				try
    		{
    		return context.DailyCash.Include("DailyCashDetails").SingleOrDefault(x=>x.DailyCashID == DailyCashID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.DailyCash GetDailyCash(int DailyCashID) 
            {
    		try
    		{
    		return context.DailyCash.SingleOrDefault(x=>x.DailyCashID == DailyCashID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<DailyCash> GetAll()
            {
    		try
    		{
                return context.DailyCash.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public DailyCash GetByID(int id)
            {
    		try
    		{
                return context.DailyCash.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(DailyCash Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.DailyCash.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                DailyCash _DailyCash = context.DailyCash.Find(id);
                context.DailyCash.Remove(_DailyCash);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                DailyCash Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(DailyCash Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.DailyCash GetDailyCashWithDailyCashDetails(int DailyCashID) 
    				{
    				try
    				{
    				return context.DailyCash.Include("DailyCashDetails").SingleOrDefault(x=>x.DailyCashID == DailyCashID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class DailyCashDetailsRepository:BaseManagerContext,IDailyCashDetailsRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~DailyCashDetailsRepository()
    		{
    		 Dispose(false);
    		}
    		public DailyCashDetailsRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct DailyCashDetailsRelatedEntities
            {
                			   
    			      public string DailyCash { get { return "DailyCash"; } }
    			  			   
    			      public string PaymentMethod { get { return "PaymentMethod"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.DailyCashDetails GetDailyCashDetailsWithAllChilds(int DailyCashDetailsID) 
            {
    				try
    		{
    		return context.DailyCashDetails.Include("DailyCash").Include("PaymentMethod").SingleOrDefault(x=>x.DailyCashDetailsID == DailyCashDetailsID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.DailyCashDetails GetDailyCashDetails(int DailyCashDetailsID) 
            {
    		try
    		{
    		return context.DailyCashDetails.SingleOrDefault(x=>x.DailyCashDetailsID == DailyCashDetailsID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<DailyCashDetails> GetAll()
            {
    		try
    		{
                return context.DailyCashDetails.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public DailyCashDetails GetByID(int id)
            {
    		try
    		{
                return context.DailyCashDetails.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(DailyCashDetails Obj)
            {		
    		try
    		{
    			
                context.DailyCashDetails.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                DailyCashDetails _DailyCashDetails = context.DailyCashDetails.Find(id);
                context.DailyCashDetails.Remove(_DailyCashDetails);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    				public void DeleteLogical(int id)
            {
              throw new NotImplementedException("La entidad carece de la propiedad ENABLE. No se puede implementar el borrado logico");
            }
    			
            public void Update(DailyCashDetails Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.DailyCashDetails GetDailyCashDetailsWithDailyCash(int DailyCashDetailsID) 
    				{
    				try
    				{
    				return context.DailyCashDetails.Include("DailyCash").SingleOrDefault(x=>x.DailyCashDetailsID == DailyCashDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.DailyCashDetails GetDailyCashDetailsWithPaymentMethod(int DailyCashDetailsID) 
    				{
    				try
    				{
    				return context.DailyCashDetails.Include("PaymentMethod").SingleOrDefault(x=>x.DailyCashDetailsID == DailyCashDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class EmailRepository:BaseManagerContext,IEmailRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~EmailRepository()
    		{
    		 Dispose(false);
    		}
    		public EmailRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct EmailRelatedEntities
            {
                			   
    			      public string Bank { get { return "Bank"; } }
    			  			   
    			      public string Customer { get { return "Customer"; } }
    			  			   
    			      public string SalesPerson { get { return "SalesPerson"; } }
    			  			   
    			      public string Suppliers { get { return "Suppliers"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Email GetEmailWithAllChilds(int EmailID) 
            {
    				try
    		{
    		return context.Email.Include("Bank").Include("Customer").Include("SalesPerson").Include("Suppliers").SingleOrDefault(x=>x.EmailID == EmailID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Email GetEmail(int EmailID) 
            {
    		try
    		{
    		return context.Email.SingleOrDefault(x=>x.EmailID == EmailID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Email> GetAll()
            {
    		try
    		{
                return context.Email.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Email GetByID(int id)
            {
    		try
    		{
                return context.Email.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Email Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Email.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Email _Email = context.Email.Find(id);
                context.Email.Remove(_Email);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Email Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Email Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Email GetEmailWithBank(int EmailID) 
    				{
    				try
    				{
    				return context.Email.Include("Bank").SingleOrDefault(x=>x.EmailID == EmailID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Email GetEmailWithCustomer(int EmailID) 
    				{
    				try
    				{
    				return context.Email.Include("Customer").SingleOrDefault(x=>x.EmailID == EmailID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Email GetEmailWithSalesPerson(int EmailID) 
    				{
    				try
    				{
    				return context.Email.Include("SalesPerson").SingleOrDefault(x=>x.EmailID == EmailID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Email GetEmailWithSuppliers(int EmailID) 
    				{
    				try
    				{
    				return context.Email.Include("Suppliers").SingleOrDefault(x=>x.EmailID == EmailID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class GeneralPaymentSupplierRepository:BaseManagerContext,IGeneralPaymentSupplierRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~GeneralPaymentSupplierRepository()
    		{
    		 Dispose(false);
    		}
    		public GeneralPaymentSupplierRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct GeneralPaymentSupplierRelatedEntities
            {
                			   
    			      public string Checks { get { return "Checks"; } }
    			  			   
    			      public string PaymentMethod { get { return "PaymentMethod"; } }
    			  			   
    			      public string PaymentSupplier { get { return "PaymentSupplier"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.GeneralPaymentSupplier GetGeneralPaymentSupplierWithAllChilds(int GeneralPaymentSupplierID) 
            {
    				try
    		{
    		return context.GeneralPaymentSupplier.Include("Checks").Include("PaymentMethod").Include("PaymentSupplier").SingleOrDefault(x=>x.GeneralPaymentSupplierID == GeneralPaymentSupplierID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.GeneralPaymentSupplier GetGeneralPaymentSupplier(int GeneralPaymentSupplierID) 
            {
    		try
    		{
    		return context.GeneralPaymentSupplier.SingleOrDefault(x=>x.GeneralPaymentSupplierID == GeneralPaymentSupplierID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<GeneralPaymentSupplier> GetAll()
            {
    		try
    		{
                return context.GeneralPaymentSupplier.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public GeneralPaymentSupplier GetByID(int id)
            {
    		try
    		{
                return context.GeneralPaymentSupplier.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(GeneralPaymentSupplier Obj)
            {		
    		try
    		{
    			
                context.GeneralPaymentSupplier.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                GeneralPaymentSupplier _GeneralPaymentSupplier = context.GeneralPaymentSupplier.Find(id);
                context.GeneralPaymentSupplier.Remove(_GeneralPaymentSupplier);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    				public void DeleteLogical(int id)
            {
              throw new NotImplementedException("La entidad carece de la propiedad ENABLE. No se puede implementar el borrado logico");
            }
    			
            public void Update(GeneralPaymentSupplier Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.GeneralPaymentSupplier GetGeneralPaymentSupplierWithChecks(int GeneralPaymentSupplierID) 
    				{
    				try
    				{
    				return context.GeneralPaymentSupplier.Include("Checks").SingleOrDefault(x=>x.GeneralPaymentSupplierID == GeneralPaymentSupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.GeneralPaymentSupplier GetGeneralPaymentSupplierWithPaymentMethod(int GeneralPaymentSupplierID) 
    				{
    				try
    				{
    				return context.GeneralPaymentSupplier.Include("PaymentMethod").SingleOrDefault(x=>x.GeneralPaymentSupplierID == GeneralPaymentSupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.GeneralPaymentSupplier GetGeneralPaymentSupplierWithPaymentSupplier(int GeneralPaymentSupplierID) 
    				{
    				try
    				{
    				return context.GeneralPaymentSupplier.Include("PaymentSupplier").SingleOrDefault(x=>x.GeneralPaymentSupplierID == GeneralPaymentSupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class PaymentMethodRepository:BaseManagerContext,IPaymentMethodRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~PaymentMethodRepository()
    		{
    		 Dispose(false);
    		}
    		public PaymentMethodRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct PaymentMethodRelatedEntities
            {
                			   
    			      public string Currency { get { return "Currency"; } }
    			  			   
    			      public string Customer { get { return "Customer"; } }
    			  			   
    			      public string DailyCashDetails { get { return "DailyCashDetails"; } }
    			  			   
    			      public string GeneralPaymentSupplier { get { return "GeneralPaymentSupplier"; } }
    			  			   
    			      public string PaymentMethodDetails { get { return "PaymentMethodDetails"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.PaymentMethod GetPaymentMethodWithAllChilds(int PaymentMethodID) 
            {
    				try
    		{
    		return context.PaymentMethod.Include("Currency").Include("Customer").Include("DailyCashDetails").Include("GeneralPaymentSupplier").Include("PaymentMethodDetails").SingleOrDefault(x=>x.PaymentMethodID == PaymentMethodID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.PaymentMethod GetPaymentMethod(int PaymentMethodID) 
            {
    		try
    		{
    		return context.PaymentMethod.SingleOrDefault(x=>x.PaymentMethodID == PaymentMethodID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<PaymentMethod> GetAll()
            {
    		try
    		{
                return context.PaymentMethod.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public PaymentMethod GetByID(int id)
            {
    		try
    		{
                return context.PaymentMethod.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(PaymentMethod Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.PaymentMethod.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                PaymentMethod _PaymentMethod = context.PaymentMethod.Find(id);
                context.PaymentMethod.Remove(_PaymentMethod);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                PaymentMethod Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(PaymentMethod Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentMethod GetPaymentMethodWithCurrency(int PaymentMethodID) 
    				{
    				try
    				{
    				return context.PaymentMethod.Include("Currency").SingleOrDefault(x=>x.PaymentMethodID == PaymentMethodID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentMethod GetPaymentMethodWithCustomer(int PaymentMethodID) 
    				{
    				try
    				{
    				return context.PaymentMethod.Include("Customer").SingleOrDefault(x=>x.PaymentMethodID == PaymentMethodID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentMethod GetPaymentMethodWithDailyCashDetails(int PaymentMethodID) 
    				{
    				try
    				{
    				return context.PaymentMethod.Include("DailyCashDetails").SingleOrDefault(x=>x.PaymentMethodID == PaymentMethodID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentMethod GetPaymentMethodWithGeneralPaymentSupplier(int PaymentMethodID) 
    				{
    				try
    				{
    				return context.PaymentMethod.Include("GeneralPaymentSupplier").SingleOrDefault(x=>x.PaymentMethodID == PaymentMethodID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentMethod GetPaymentMethodWithPaymentMethodDetails(int PaymentMethodID) 
    				{
    				try
    				{
    				return context.PaymentMethod.Include("PaymentMethodDetails").SingleOrDefault(x=>x.PaymentMethodID == PaymentMethodID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class PaymentMethodDetailsRepository:BaseManagerContext,IPaymentMethodDetailsRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~PaymentMethodDetailsRepository()
    		{
    		 Dispose(false);
    		}
    		public PaymentMethodDetailsRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct PaymentMethodDetailsRelatedEntities
            {
                			   
    			      public string PaymentMethod { get { return "PaymentMethod"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.PaymentMethodDetails GetPaymentMethodDetailsWithAllChilds(int PaymentMethodDetailsID) 
            {
    				try
    		{
    		return context.PaymentMethodDetails.Include("PaymentMethod").SingleOrDefault(x=>x.PaymentMethodDetailsID == PaymentMethodDetailsID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.PaymentMethodDetails GetPaymentMethodDetails(int PaymentMethodDetailsID) 
            {
    		try
    		{
    		return context.PaymentMethodDetails.SingleOrDefault(x=>x.PaymentMethodDetailsID == PaymentMethodDetailsID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<PaymentMethodDetails> GetAll()
            {
    		try
    		{
                return context.PaymentMethodDetails.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public PaymentMethodDetails GetByID(int id)
            {
    		try
    		{
                return context.PaymentMethodDetails.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(PaymentMethodDetails Obj)
            {		
    		try
    		{
    			
                context.PaymentMethodDetails.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                PaymentMethodDetails _PaymentMethodDetails = context.PaymentMethodDetails.Find(id);
                context.PaymentMethodDetails.Remove(_PaymentMethodDetails);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    				public void DeleteLogical(int id)
            {
              throw new NotImplementedException("La entidad carece de la propiedad ENABLE. No se puede implementar el borrado logico");
            }
    			
            public void Update(PaymentMethodDetails Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentMethodDetails GetPaymentMethodDetailsWithPaymentMethod(int PaymentMethodDetailsID) 
    				{
    				try
    				{
    				return context.PaymentMethodDetails.Include("PaymentMethod").SingleOrDefault(x=>x.PaymentMethodDetailsID == PaymentMethodDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class PaymentSupplierRepository:BaseManagerContext,IPaymentSupplierRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~PaymentSupplierRepository()
    		{
    		 Dispose(false);
    		}
    		public PaymentSupplierRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct PaymentSupplierRelatedEntities
            {
                			   
    			      public string GeneralPaymentSupplier { get { return "GeneralPaymentSupplier"; } }
    			  			   
    			      public string Suppliers { get { return "Suppliers"; } }
    			  			   
    			      public string Tax { get { return "Tax"; } }
    			  			   
    			      public string PaymentSupplierDetails { get { return "PaymentSupplierDetails"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.PaymentSupplier GetPaymentSupplierWithAllChilds(int PaymentSupplierID) 
            {
    				try
    		{
    		return context.PaymentSupplier.Include("GeneralPaymentSupplier").Include("Suppliers").Include("Tax").Include("PaymentSupplierDetails").SingleOrDefault(x=>x.PaymentSupplierID == PaymentSupplierID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.PaymentSupplier GetPaymentSupplier(int PaymentSupplierID) 
            {
    		try
    		{
    		return context.PaymentSupplier.SingleOrDefault(x=>x.PaymentSupplierID == PaymentSupplierID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<PaymentSupplier> GetAll()
            {
    		try
    		{
                return context.PaymentSupplier.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public PaymentSupplier GetByID(int id)
            {
    		try
    		{
                return context.PaymentSupplier.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(PaymentSupplier Obj)
            {		
    		try
    		{
    			
                context.PaymentSupplier.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                PaymentSupplier _PaymentSupplier = context.PaymentSupplier.Find(id);
                context.PaymentSupplier.Remove(_PaymentSupplier);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    				public void DeleteLogical(int id)
            {
              throw new NotImplementedException("La entidad carece de la propiedad ENABLE. No se puede implementar el borrado logico");
            }
    			
            public void Update(PaymentSupplier Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentSupplier GetPaymentSupplierWithGeneralPaymentSupplier(int PaymentSupplierID) 
    				{
    				try
    				{
    				return context.PaymentSupplier.Include("GeneralPaymentSupplier").SingleOrDefault(x=>x.PaymentSupplierID == PaymentSupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentSupplier GetPaymentSupplierWithSuppliers(int PaymentSupplierID) 
    				{
    				try
    				{
    				return context.PaymentSupplier.Include("Suppliers").SingleOrDefault(x=>x.PaymentSupplierID == PaymentSupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentSupplier GetPaymentSupplierWithTax(int PaymentSupplierID) 
    				{
    				try
    				{
    				return context.PaymentSupplier.Include("Tax").SingleOrDefault(x=>x.PaymentSupplierID == PaymentSupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentSupplier GetPaymentSupplierWithPaymentSupplierDetails(int PaymentSupplierID) 
    				{
    				try
    				{
    				return context.PaymentSupplier.Include("PaymentSupplierDetails").SingleOrDefault(x=>x.PaymentSupplierID == PaymentSupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class PaymentSupplierDetailsRepository:BaseManagerContext,IPaymentSupplierDetailsRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~PaymentSupplierDetailsRepository()
    		{
    		 Dispose(false);
    		}
    		public PaymentSupplierDetailsRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct PaymentSupplierDetailsRelatedEntities
            {
                			   
    			      public string PaymentSupplier { get { return "PaymentSupplier"; } }
    			  			   
    			      public string Products { get { return "Products"; } }
    			  			   
    			      public string Tax { get { return "Tax"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.PaymentSupplierDetails GetPaymentSupplierDetailsWithAllChilds(int PaymentSupplierDetailsID) 
            {
    				try
    		{
    		return context.PaymentSupplierDetails.Include("PaymentSupplier").Include("Products").Include("Tax").SingleOrDefault(x=>x.PaymentSupplierDetailsID == PaymentSupplierDetailsID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.PaymentSupplierDetails GetPaymentSupplierDetails(int PaymentSupplierDetailsID) 
            {
    		try
    		{
    		return context.PaymentSupplierDetails.SingleOrDefault(x=>x.PaymentSupplierDetailsID == PaymentSupplierDetailsID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<PaymentSupplierDetails> GetAll()
            {
    		try
    		{
                return context.PaymentSupplierDetails.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public PaymentSupplierDetails GetByID(int id)
            {
    		try
    		{
                return context.PaymentSupplierDetails.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(PaymentSupplierDetails Obj)
            {		
    		try
    		{
    			
                context.PaymentSupplierDetails.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                PaymentSupplierDetails _PaymentSupplierDetails = context.PaymentSupplierDetails.Find(id);
                context.PaymentSupplierDetails.Remove(_PaymentSupplierDetails);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    				public void DeleteLogical(int id)
            {
              throw new NotImplementedException("La entidad carece de la propiedad ENABLE. No se puede implementar el borrado logico");
            }
    			
            public void Update(PaymentSupplierDetails Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentSupplierDetails GetPaymentSupplierDetailsWithPaymentSupplier(int PaymentSupplierDetailsID) 
    				{
    				try
    				{
    				return context.PaymentSupplierDetails.Include("PaymentSupplier").SingleOrDefault(x=>x.PaymentSupplierDetailsID == PaymentSupplierDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentSupplierDetails GetPaymentSupplierDetailsWithProducts(int PaymentSupplierDetailsID) 
    				{
    				try
    				{
    				return context.PaymentSupplierDetails.Include("Products").SingleOrDefault(x=>x.PaymentSupplierDetailsID == PaymentSupplierDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.PaymentSupplierDetails GetPaymentSupplierDetailsWithTax(int PaymentSupplierDetailsID) 
    				{
    				try
    				{
    				return context.PaymentSupplierDetails.Include("Tax").SingleOrDefault(x=>x.PaymentSupplierDetailsID == PaymentSupplierDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class PhonesRepository:BaseManagerContext,IPhonesRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~PhonesRepository()
    		{
    		 Dispose(false);
    		}
    		public PhonesRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct PhonesRelatedEntities
            {
                			   
    			      public string Bank { get { return "Bank"; } }
    			  			   
    			      public string Customer { get { return "Customer"; } }
    			  			   
    			      public string SalesPerson { get { return "SalesPerson"; } }
    			  			   
    			      public string Suppliers { get { return "Suppliers"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Phones GetPhonesWithAllChilds(int PhoneID) 
            {
    				try
    		{
    		return context.Phones.Include("Bank").Include("Customer").Include("SalesPerson").Include("Suppliers").SingleOrDefault(x=>x.PhoneID == PhoneID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Phones GetPhones(int PhoneID) 
            {
    		try
    		{
    		return context.Phones.SingleOrDefault(x=>x.PhoneID == PhoneID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Phones> GetAll()
            {
    		try
    		{
                return context.Phones.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Phones GetByID(int id)
            {
    		try
    		{
                return context.Phones.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Phones Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Phones.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Phones _Phones = context.Phones.Find(id);
                context.Phones.Remove(_Phones);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Phones Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Phones Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Phones GetPhonesWithBank(int PhoneID) 
    				{
    				try
    				{
    				return context.Phones.Include("Bank").SingleOrDefault(x=>x.PhoneID == PhoneID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Phones GetPhonesWithCustomer(int PhoneID) 
    				{
    				try
    				{
    				return context.Phones.Include("Customer").SingleOrDefault(x=>x.PhoneID == PhoneID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Phones GetPhonesWithSalesPerson(int PhoneID) 
    				{
    				try
    				{
    				return context.Phones.Include("SalesPerson").SingleOrDefault(x=>x.PhoneID == PhoneID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Phones GetPhonesWithSuppliers(int PhoneID) 
    				{
    				try
    				{
    				return context.Phones.Include("Suppliers").SingleOrDefault(x=>x.PhoneID == PhoneID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class ProductsRepository:BaseManagerContext,IProductsRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~ProductsRepository()
    		{
    		 Dispose(false);
    		}
    		public ProductsRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct ProductsRelatedEntities
            {
                			   
    			      public string BuyPriceListDetails { get { return "BuyPriceListDetails"; } }
    			  			   
    			      public string PaymentSupplierDetails { get { return "PaymentSupplierDetails"; } }
    			  			   
    			      public string SalesPriceListDetails { get { return "SalesPriceListDetails"; } }
    			  			   
    			      public string SalesDetails { get { return "SalesDetails"; } }
    			  			   
    			      public string SalesPriceListByCustomer { get { return "SalesPriceListByCustomer"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Products GetProductsWithAllChilds(int ProductID) 
            {
    				try
    		{
    		return context.Products.Include("BuyPriceListDetails").Include("PaymentSupplierDetails").Include("SalesPriceListDetails").Include("SalesDetails").Include("SalesPriceListByCustomer").SingleOrDefault(x=>x.ProductID == ProductID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Products GetProducts(int ProductID) 
            {
    		try
    		{
    		return context.Products.SingleOrDefault(x=>x.ProductID == ProductID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Products> GetAll()
            {
    		try
    		{
                return context.Products.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Products GetByID(int id)
            {
    		try
    		{
                return context.Products.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Products Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Products.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Products _Products = context.Products.Find(id);
                context.Products.Remove(_Products);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Products Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Products Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Products GetProductsWithBuyPriceListDetails(int ProductID) 
    				{
    				try
    				{
    				return context.Products.Include("BuyPriceListDetails").SingleOrDefault(x=>x.ProductID == ProductID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Products GetProductsWithPaymentSupplierDetails(int ProductID) 
    				{
    				try
    				{
    				return context.Products.Include("PaymentSupplierDetails").SingleOrDefault(x=>x.ProductID == ProductID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Products GetProductsWithSalesPriceListDetails(int ProductID) 
    				{
    				try
    				{
    				return context.Products.Include("SalesPriceListDetails").SingleOrDefault(x=>x.ProductID == ProductID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Products GetProductsWithSalesDetails(int ProductID) 
    				{
    				try
    				{
    				return context.Products.Include("SalesDetails").SingleOrDefault(x=>x.ProductID == ProductID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Products GetProductsWithSalesPriceListByCustomer(int ProductID) 
    				{
    				try
    				{
    				return context.Products.Include("SalesPriceListByCustomer").SingleOrDefault(x=>x.ProductID == ProductID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class ProvinceRepository:BaseManagerContext,IProvinceRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~ProvinceRepository()
    		{
    		 Dispose(false);
    		}
    		public ProvinceRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct ProvinceRelatedEntities
            {
                			   
    			      public string City { get { return "City"; } }
    			  			   
    			      public string Country { get { return "Country"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Province GetProvinceWithAllChilds(int ProvinceID) 
            {
    				try
    		{
    		return context.Province.Include("City").Include("Country").SingleOrDefault(x=>x.ProvinceID == ProvinceID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Province GetProvince(int ProvinceID) 
            {
    		try
    		{
    		return context.Province.SingleOrDefault(x=>x.ProvinceID == ProvinceID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Province> GetAll()
            {
    		try
    		{
                return context.Province.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Province GetByID(int id)
            {
    		try
    		{
                return context.Province.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Province Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Province.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Province _Province = context.Province.Find(id);
                context.Province.Remove(_Province);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Province Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Province Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Province GetProvinceWithCity(int ProvinceID) 
    				{
    				try
    				{
    				return context.Province.Include("City").SingleOrDefault(x=>x.ProvinceID == ProvinceID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Province GetProvinceWithCountry(int ProvinceID) 
    				{
    				try
    				{
    				return context.Province.Include("Country").SingleOrDefault(x=>x.ProvinceID == ProvinceID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class SalesRepository:BaseManagerContext,ISalesRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~SalesRepository()
    		{
    		 Dispose(false);
    		}
    		public SalesRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct SalesRelatedEntities
            {
                			   
    			      public string Customer { get { return "Customer"; } }
    			  			   
    			      public string SalesPerson { get { return "SalesPerson"; } }
    			  			   
    			      public string SalesPriceList { get { return "SalesPriceList"; } }
    			  			   
    			      public string SalesStatus { get { return "SalesStatus"; } }
    			  			   
    			      public string Tax { get { return "Tax"; } }
    			  			   
    			      public string SalesDetails { get { return "SalesDetails"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Sales GetSalesWithAllChilds(int SalesID) 
            {
    				try
    		{
    		return context.Sales.Include("Customer").Include("SalesPerson").Include("SalesPriceList").Include("SalesStatus").Include("Tax").Include("SalesDetails").SingleOrDefault(x=>x.SalesID == SalesID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Sales GetSales(int SalesID) 
            {
    		try
    		{
    		return context.Sales.SingleOrDefault(x=>x.SalesID == SalesID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Sales> GetAll()
            {
    		try
    		{
                return context.Sales.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Sales GetByID(int id)
            {
    		try
    		{
                return context.Sales.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Sales Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Sales.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Sales _Sales = context.Sales.Find(id);
                context.Sales.Remove(_Sales);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Sales Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Sales Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Sales GetSalesWithCustomer(int SalesID) 
    				{
    				try
    				{
    				return context.Sales.Include("Customer").SingleOrDefault(x=>x.SalesID == SalesID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Sales GetSalesWithSalesPerson(int SalesID) 
    				{
    				try
    				{
    				return context.Sales.Include("SalesPerson").SingleOrDefault(x=>x.SalesID == SalesID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Sales GetSalesWithSalesPriceList(int SalesID) 
    				{
    				try
    				{
    				return context.Sales.Include("SalesPriceList").SingleOrDefault(x=>x.SalesID == SalesID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Sales GetSalesWithSalesStatus(int SalesID) 
    				{
    				try
    				{
    				return context.Sales.Include("SalesStatus").SingleOrDefault(x=>x.SalesID == SalesID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Sales GetSalesWithTax(int SalesID) 
    				{
    				try
    				{
    				return context.Sales.Include("Tax").SingleOrDefault(x=>x.SalesID == SalesID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Sales GetSalesWithSalesDetails(int SalesID) 
    				{
    				try
    				{
    				return context.Sales.Include("SalesDetails").SingleOrDefault(x=>x.SalesID == SalesID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class SalesDetailsRepository:BaseManagerContext,ISalesDetailsRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~SalesDetailsRepository()
    		{
    		 Dispose(false);
    		}
    		public SalesDetailsRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct SalesDetailsRelatedEntities
            {
                			   
    			      public string Products { get { return "Products"; } }
    			  			   
    			      public string Sales { get { return "Sales"; } }
    			  			   
    			      public string Tax { get { return "Tax"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.SalesDetails GetSalesDetailsWithAllChilds(int SalesDetailsID) 
            {
    				try
    		{
    		return context.SalesDetails.Include("Products").Include("Sales").Include("Tax").SingleOrDefault(x=>x.SalesDetailsID == SalesDetailsID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.SalesDetails GetSalesDetails(int SalesDetailsID) 
            {
    		try
    		{
    		return context.SalesDetails.SingleOrDefault(x=>x.SalesDetailsID == SalesDetailsID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<SalesDetails> GetAll()
            {
    		try
    		{
                return context.SalesDetails.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public SalesDetails GetByID(int id)
            {
    		try
    		{
                return context.SalesDetails.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(SalesDetails Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.SalesDetails.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                SalesDetails _SalesDetails = context.SalesDetails.Find(id);
                context.SalesDetails.Remove(_SalesDetails);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                SalesDetails Obj = GetByID(id);
                Obj.Enable = false;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(SalesDetails Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesDetails GetSalesDetailsWithProducts(int SalesDetailsID) 
    				{
    				try
    				{
    				return context.SalesDetails.Include("Products").SingleOrDefault(x=>x.SalesDetailsID == SalesDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesDetails GetSalesDetailsWithSales(int SalesDetailsID) 
    				{
    				try
    				{
    				return context.SalesDetails.Include("Sales").SingleOrDefault(x=>x.SalesDetailsID == SalesDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesDetails GetSalesDetailsWithTax(int SalesDetailsID) 
    				{
    				try
    				{
    				return context.SalesDetails.Include("Tax").SingleOrDefault(x=>x.SalesDetailsID == SalesDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class SalesPersonRepository:BaseManagerContext,ISalesPersonRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~SalesPersonRepository()
    		{
    		 Dispose(false);
    		}
    		public SalesPersonRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct SalesPersonRelatedEntities
            {
                			   
    			      public string City { get { return "City"; } }
    			  			   
    			      public string Customer { get { return "Customer"; } }
    			  			   
    			      public string Sales { get { return "Sales"; } }
    			  			   
    			      public string Address { get { return "Address"; } }
    			  			   
    			      public string Email { get { return "Email"; } }
    			  			   
    			      public string Phones { get { return "Phones"; } }
    			  			   
    			      public string SalesPriceList { get { return "SalesPriceList"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.SalesPerson GetSalesPersonWithAllChilds(int SalesPersonID) 
            {
    				try
    		{
    		return context.SalesPerson.Include("City").Include("Customer").Include("Sales").Include("Address").Include("Email").Include("Phones").Include("SalesPriceList").SingleOrDefault(x=>x.SalesPersonID == SalesPersonID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.SalesPerson GetSalesPerson(int SalesPersonID) 
            {
    		try
    		{
    		return context.SalesPerson.SingleOrDefault(x=>x.SalesPersonID == SalesPersonID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<SalesPerson> GetAll()
            {
    		try
    		{
                return context.SalesPerson.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public SalesPerson GetByID(int id)
            {
    		try
    		{
                return context.SalesPerson.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(SalesPerson Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.SalesPerson.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                SalesPerson _SalesPerson = context.SalesPerson.Find(id);
                context.SalesPerson.Remove(_SalesPerson);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                SalesPerson Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(SalesPerson Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPerson GetSalesPersonWithCity(int SalesPersonID) 
    				{
    				try
    				{
    				return context.SalesPerson.Include("City").SingleOrDefault(x=>x.SalesPersonID == SalesPersonID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPerson GetSalesPersonWithCustomer(int SalesPersonID) 
    				{
    				try
    				{
    				return context.SalesPerson.Include("Customer").SingleOrDefault(x=>x.SalesPersonID == SalesPersonID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPerson GetSalesPersonWithSales(int SalesPersonID) 
    				{
    				try
    				{
    				return context.SalesPerson.Include("Sales").SingleOrDefault(x=>x.SalesPersonID == SalesPersonID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPerson GetSalesPersonWithAddress(int SalesPersonID) 
    				{
    				try
    				{
    				return context.SalesPerson.Include("Address").SingleOrDefault(x=>x.SalesPersonID == SalesPersonID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPerson GetSalesPersonWithEmail(int SalesPersonID) 
    				{
    				try
    				{
    				return context.SalesPerson.Include("Email").SingleOrDefault(x=>x.SalesPersonID == SalesPersonID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPerson GetSalesPersonWithPhones(int SalesPersonID) 
    				{
    				try
    				{
    				return context.SalesPerson.Include("Phones").SingleOrDefault(x=>x.SalesPersonID == SalesPersonID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPerson GetSalesPersonWithSalesPriceList(int SalesPersonID) 
    				{
    				try
    				{
    				return context.SalesPerson.Include("SalesPriceList").SingleOrDefault(x=>x.SalesPersonID == SalesPersonID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class SalesPriceListRepository:BaseManagerContext,ISalesPriceListRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~SalesPriceListRepository()
    		{
    		 Dispose(false);
    		}
    		public SalesPriceListRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct SalesPriceListRelatedEntities
            {
                			   
    			      public string Customer { get { return "Customer"; } }
    			  			   
    			      public string Sales { get { return "Sales"; } }
    			  			   
    			      public string SalesPriceListDetails { get { return "SalesPriceListDetails"; } }
    			  			   
    			      public string SalesPerson { get { return "SalesPerson"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.SalesPriceList GetSalesPriceListWithAllChilds(int SalesPriceListID) 
            {
    				try
    		{
    		return context.SalesPriceList.Include("Customer").Include("Sales").Include("SalesPriceListDetails").Include("SalesPerson").SingleOrDefault(x=>x.SalesPriceListID == SalesPriceListID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.SalesPriceList GetSalesPriceList(int SalesPriceListID) 
            {
    		try
    		{
    		return context.SalesPriceList.SingleOrDefault(x=>x.SalesPriceListID == SalesPriceListID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<SalesPriceList> GetAll()
            {
    		try
    		{
                return context.SalesPriceList.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public SalesPriceList GetByID(int id)
            {
    		try
    		{
                return context.SalesPriceList.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(SalesPriceList Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.SalesPriceList.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                SalesPriceList _SalesPriceList = context.SalesPriceList.Find(id);
                context.SalesPriceList.Remove(_SalesPriceList);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                SalesPriceList Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(SalesPriceList Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPriceList GetSalesPriceListWithCustomer(int SalesPriceListID) 
    				{
    				try
    				{
    				return context.SalesPriceList.Include("Customer").SingleOrDefault(x=>x.SalesPriceListID == SalesPriceListID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPriceList GetSalesPriceListWithSales(int SalesPriceListID) 
    				{
    				try
    				{
    				return context.SalesPriceList.Include("Sales").SingleOrDefault(x=>x.SalesPriceListID == SalesPriceListID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPriceList GetSalesPriceListWithSalesPriceListDetails(int SalesPriceListID) 
    				{
    				try
    				{
    				return context.SalesPriceList.Include("SalesPriceListDetails").SingleOrDefault(x=>x.SalesPriceListID == SalesPriceListID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPriceList GetSalesPriceListWithSalesPerson(int SalesPriceListID) 
    				{
    				try
    				{
    				return context.SalesPriceList.Include("SalesPerson").SingleOrDefault(x=>x.SalesPriceListID == SalesPriceListID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class SalesPriceListByCustomerRepository:BaseManagerContext,ISalesPriceListByCustomerRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~SalesPriceListByCustomerRepository()
    		{
    		 Dispose(false);
    		}
    		public SalesPriceListByCustomerRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct SalesPriceListByCustomerRelatedEntities
            {
                			   
    			      public string Customer { get { return "Customer"; } }
    			  			   
    			      public string Products { get { return "Products"; } }
    			  			   
    			      public string Tax { get { return "Tax"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.SalesPriceListByCustomer GetSalesPriceListByCustomerWithAllChilds(int SalesPriceListByCustomerID) 
            {
    				try
    		{
    		return context.SalesPriceListByCustomer.Include("Customer").Include("Products").Include("Tax").SingleOrDefault(x=>x.SalesPriceListByCustomerID == SalesPriceListByCustomerID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.SalesPriceListByCustomer GetSalesPriceListByCustomer(int SalesPriceListByCustomerID) 
            {
    		try
    		{
    		return context.SalesPriceListByCustomer.SingleOrDefault(x=>x.SalesPriceListByCustomerID == SalesPriceListByCustomerID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<SalesPriceListByCustomer> GetAll()
            {
    		try
    		{
                return context.SalesPriceListByCustomer.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public SalesPriceListByCustomer GetByID(int id)
            {
    		try
    		{
                return context.SalesPriceListByCustomer.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(SalesPriceListByCustomer Obj)
            {		
    		try
    		{
    			
                context.SalesPriceListByCustomer.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                SalesPriceListByCustomer _SalesPriceListByCustomer = context.SalesPriceListByCustomer.Find(id);
                context.SalesPriceListByCustomer.Remove(_SalesPriceListByCustomer);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    				public void DeleteLogical(int id)
            {
              throw new NotImplementedException("La entidad carece de la propiedad ENABLE. No se puede implementar el borrado logico");
            }
    			
            public void Update(SalesPriceListByCustomer Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPriceListByCustomer GetSalesPriceListByCustomerWithCustomer(int SalesPriceListByCustomerID) 
    				{
    				try
    				{
    				return context.SalesPriceListByCustomer.Include("Customer").SingleOrDefault(x=>x.SalesPriceListByCustomerID == SalesPriceListByCustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPriceListByCustomer GetSalesPriceListByCustomerWithProducts(int SalesPriceListByCustomerID) 
    				{
    				try
    				{
    				return context.SalesPriceListByCustomer.Include("Products").SingleOrDefault(x=>x.SalesPriceListByCustomerID == SalesPriceListByCustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPriceListByCustomer GetSalesPriceListByCustomerWithTax(int SalesPriceListByCustomerID) 
    				{
    				try
    				{
    				return context.SalesPriceListByCustomer.Include("Tax").SingleOrDefault(x=>x.SalesPriceListByCustomerID == SalesPriceListByCustomerID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class SalesPriceListDetailsRepository:BaseManagerContext,ISalesPriceListDetailsRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~SalesPriceListDetailsRepository()
    		{
    		 Dispose(false);
    		}
    		public SalesPriceListDetailsRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct SalesPriceListDetailsRelatedEntities
            {
                			   
    			      public string Products { get { return "Products"; } }
    			  			   
    			      public string SalesPriceList { get { return "SalesPriceList"; } }
    			  			   
    			      public string Tax { get { return "Tax"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.SalesPriceListDetails GetSalesPriceListDetailsWithAllChilds(int SalesPriceListDetailsID) 
            {
    				try
    		{
    		return context.SalesPriceListDetails.Include("Products").Include("SalesPriceList").Include("Tax").SingleOrDefault(x=>x.SalesPriceListDetailsID == SalesPriceListDetailsID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.SalesPriceListDetails GetSalesPriceListDetails(int SalesPriceListDetailsID) 
            {
    		try
    		{
    		return context.SalesPriceListDetails.SingleOrDefault(x=>x.SalesPriceListDetailsID == SalesPriceListDetailsID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<SalesPriceListDetails> GetAll()
            {
    		try
    		{
                return context.SalesPriceListDetails.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public SalesPriceListDetails GetByID(int id)
            {
    		try
    		{
                return context.SalesPriceListDetails.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(SalesPriceListDetails Obj)
            {		
    		try
    		{
    			
                context.SalesPriceListDetails.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                SalesPriceListDetails _SalesPriceListDetails = context.SalesPriceListDetails.Find(id);
                context.SalesPriceListDetails.Remove(_SalesPriceListDetails);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    				public void DeleteLogical(int id)
            {
              throw new NotImplementedException("La entidad carece de la propiedad ENABLE. No se puede implementar el borrado logico");
            }
    			
            public void Update(SalesPriceListDetails Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPriceListDetails GetSalesPriceListDetailsWithProducts(int SalesPriceListDetailsID) 
    				{
    				try
    				{
    				return context.SalesPriceListDetails.Include("Products").SingleOrDefault(x=>x.SalesPriceListDetailsID == SalesPriceListDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPriceListDetails GetSalesPriceListDetailsWithSalesPriceList(int SalesPriceListDetailsID) 
    				{
    				try
    				{
    				return context.SalesPriceListDetails.Include("SalesPriceList").SingleOrDefault(x=>x.SalesPriceListDetailsID == SalesPriceListDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesPriceListDetails GetSalesPriceListDetailsWithTax(int SalesPriceListDetailsID) 
    				{
    				try
    				{
    				return context.SalesPriceListDetails.Include("Tax").SingleOrDefault(x=>x.SalesPriceListDetailsID == SalesPriceListDetailsID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class SalesStatusRepository:BaseManagerContext,ISalesStatusRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~SalesStatusRepository()
    		{
    		 Dispose(false);
    		}
    		public SalesStatusRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct SalesStatusRelatedEntities
            {
                			   
    			      public string Sales { get { return "Sales"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.SalesStatus GetSalesStatusWithAllChilds(int StatusID) 
            {
    				try
    		{
    		return context.SalesStatus.Include("Sales").SingleOrDefault(x=>x.StatusID == StatusID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.SalesStatus GetSalesStatus(int StatusID) 
            {
    		try
    		{
    		return context.SalesStatus.SingleOrDefault(x=>x.StatusID == StatusID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<SalesStatus> GetAll()
            {
    		try
    		{
                return context.SalesStatus.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public SalesStatus GetByID(int id)
            {
    		try
    		{
                return context.SalesStatus.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(SalesStatus Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.SalesStatus.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                SalesStatus _SalesStatus = context.SalesStatus.Find(id);
                context.SalesStatus.Remove(_SalesStatus);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                SalesStatus Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(SalesStatus Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.SalesStatus GetSalesStatusWithSales(int StatusID) 
    				{
    				try
    				{
    				return context.SalesStatus.Include("Sales").SingleOrDefault(x=>x.StatusID == StatusID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class SuppliersRepository:BaseManagerContext,ISuppliersRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~SuppliersRepository()
    		{
    		 Dispose(false);
    		}
    		public SuppliersRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct SuppliersRelatedEntities
            {
                			   
    			      public string BuyPriceList { get { return "BuyPriceList"; } }
    			  			   
    			      public string PaymentSupplier { get { return "PaymentSupplier"; } }
    			  			   
    			      public string Address { get { return "Address"; } }
    			  			   
    			      public string Email { get { return "Email"; } }
    			  			   
    			      public string Phones { get { return "Phones"; } }
    			  			   
    			      public string BuyPriceList1 { get { return "BuyPriceList1"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Suppliers GetSuppliersWithAllChilds(int SupplierID) 
            {
    				try
    		{
    		return context.Suppliers.Include("BuyPriceList").Include("PaymentSupplier").Include("Address").Include("Email").Include("Phones").Include("BuyPriceList1").SingleOrDefault(x=>x.SupplierID == SupplierID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Suppliers GetSuppliers(int SupplierID) 
            {
    		try
    		{
    		return context.Suppliers.SingleOrDefault(x=>x.SupplierID == SupplierID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Suppliers> GetAll()
            {
    		try
    		{
                return context.Suppliers.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Suppliers GetByID(int id)
            {
    		try
    		{
                return context.Suppliers.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Suppliers Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Suppliers.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Suppliers _Suppliers = context.Suppliers.Find(id);
                context.Suppliers.Remove(_Suppliers);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Suppliers Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Suppliers Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Suppliers GetSuppliersWithBuyPriceList(int SupplierID) 
    				{
    				try
    				{
    				return context.Suppliers.Include("BuyPriceList").SingleOrDefault(x=>x.SupplierID == SupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Suppliers GetSuppliersWithPaymentSupplier(int SupplierID) 
    				{
    				try
    				{
    				return context.Suppliers.Include("PaymentSupplier").SingleOrDefault(x=>x.SupplierID == SupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Suppliers GetSuppliersWithAddress(int SupplierID) 
    				{
    				try
    				{
    				return context.Suppliers.Include("Address").SingleOrDefault(x=>x.SupplierID == SupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Suppliers GetSuppliersWithEmail(int SupplierID) 
    				{
    				try
    				{
    				return context.Suppliers.Include("Email").SingleOrDefault(x=>x.SupplierID == SupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Suppliers GetSuppliersWithPhones(int SupplierID) 
    				{
    				try
    				{
    				return context.Suppliers.Include("Phones").SingleOrDefault(x=>x.SupplierID == SupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Suppliers GetSuppliersWithBuyPriceList1(int SupplierID) 
    				{
    				try
    				{
    				return context.Suppliers.Include("BuyPriceList1").SingleOrDefault(x=>x.SupplierID == SupplierID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class TaxRepository:BaseManagerContext,ITaxRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~TaxRepository()
    		{
    		 Dispose(false);
    		}
    		public TaxRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct TaxRelatedEntities
            {
                			   
    			      public string BuyPriceListDetails { get { return "BuyPriceListDetails"; } }
    			  			   
    			      public string PaymentSupplier { get { return "PaymentSupplier"; } }
    			  			   
    			      public string PaymentSupplierDetails { get { return "PaymentSupplierDetails"; } }
    			  			   
    			      public string Sales { get { return "Sales"; } }
    			  			   
    			      public string SalesDetails { get { return "SalesDetails"; } }
    			  			   
    			      public string SalesPriceListByCustomer { get { return "SalesPriceListByCustomer"; } }
    			  			   
    			      public string SalesPriceListDetails { get { return "SalesPriceListDetails"; } }
    			  			   
    			      public string TaxFigure { get { return "TaxFigure"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.Tax GetTaxWithAllChilds(int TaxID) 
            {
    				try
    		{
    		return context.Tax.Include("BuyPriceListDetails").Include("PaymentSupplier").Include("PaymentSupplierDetails").Include("Sales").Include("SalesDetails").Include("SalesPriceListByCustomer").Include("SalesPriceListDetails").Include("TaxFigure").SingleOrDefault(x=>x.TaxID == TaxID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.Tax GetTax(int TaxID) 
            {
    		try
    		{
    		return context.Tax.SingleOrDefault(x=>x.TaxID == TaxID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<Tax> GetAll()
            {
    		try
    		{
                return context.Tax.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public Tax GetByID(int id)
            {
    		try
    		{
                return context.Tax.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(Tax Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.Tax.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                Tax _Tax = context.Tax.Find(id);
                context.Tax.Remove(_Tax);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                Tax Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(Tax Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Tax GetTaxWithBuyPriceListDetails(int TaxID) 
    				{
    				try
    				{
    				return context.Tax.Include("BuyPriceListDetails").SingleOrDefault(x=>x.TaxID == TaxID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Tax GetTaxWithPaymentSupplier(int TaxID) 
    				{
    				try
    				{
    				return context.Tax.Include("PaymentSupplier").SingleOrDefault(x=>x.TaxID == TaxID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Tax GetTaxWithPaymentSupplierDetails(int TaxID) 
    				{
    				try
    				{
    				return context.Tax.Include("PaymentSupplierDetails").SingleOrDefault(x=>x.TaxID == TaxID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Tax GetTaxWithSales(int TaxID) 
    				{
    				try
    				{
    				return context.Tax.Include("Sales").SingleOrDefault(x=>x.TaxID == TaxID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Tax GetTaxWithSalesDetails(int TaxID) 
    				{
    				try
    				{
    				return context.Tax.Include("SalesDetails").SingleOrDefault(x=>x.TaxID == TaxID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Tax GetTaxWithSalesPriceListByCustomer(int TaxID) 
    				{
    				try
    				{
    				return context.Tax.Include("SalesPriceListByCustomer").SingleOrDefault(x=>x.TaxID == TaxID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Tax GetTaxWithSalesPriceListDetails(int TaxID) 
    				{
    				try
    				{
    				return context.Tax.Include("SalesPriceListDetails").SingleOrDefault(x=>x.TaxID == TaxID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.Tax GetTaxWithTaxFigure(int TaxID) 
    				{
    				try
    				{
    				return context.Tax.Include("TaxFigure").SingleOrDefault(x=>x.TaxID == TaxID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class TaxFigureRepository:BaseManagerContext,ITaxFigureRepository
    {
    		private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		~TaxFigureRepository()
    		{
    		 Dispose(false);
    		}
    		public TaxFigureRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
    		public struct TaxFigureRelatedEntities
            {
                			   
    			      public string Customer { get { return "Customer"; } }
    			  			   
    			      public string Tax { get { return "Tax"; } }
    			          }		
    
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		 public SilkeyERP.Model.TaxFigure GetTaxFigureWithAllChilds(int TaxFigureID) 
            {
    				try
    		{
    		return context.TaxFigure.Include("Customer").Include("Tax").SingleOrDefault(x=>x.TaxFigureID == TaxFigureID);        
    		}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    			
            public SilkeyERP.Model.TaxFigure GetTaxFigure(int TaxFigureID) 
            {
    		try
    		{
    		return context.TaxFigure.SingleOrDefault(x=>x.TaxFigureID == TaxFigureID);        
    			}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    		}
    
    
    		//*****************************************************************************************
    		//***************************Methods By NAGFwk*********************************************
    		//*****************************************************************************************
    		public IEnumerable<TaxFigure> GetAll()
            {
    		try
    		{
                return context.TaxFigure.ToList();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    
            public TaxFigure GetByID(int id)
            {
    		try
    		{
                return context.TaxFigure.Find(id);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Insert(TaxFigure Obj)
            {		
    		try
    		{
    						Obj.CreateDate = DateTime.Now;
    			
                context.TaxFigure.Add(Obj);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		
            public void Delete(int id)
            {
    		try
    		{
                TaxFigure _TaxFigure = context.TaxFigure.Find(id);
                context.TaxFigure.Remove(_TaxFigure);
                Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    		        public void DeleteLogical(int id)
            {
    		try
    		{
                TaxFigure Obj = GetByID(id);
                Obj.Enable = false;
    						Obj.ModificationDate = DateTime.Now;
    			            Update(Obj);
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }
    			
            public void Update(TaxFigure Obj)
            {
    		try
    		{	
                context.Entry(Obj).State = EntityState.Modified;
    						Obj.ModificationDate = DateTime.Now;
    			            Save();
    				}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
            }	
    
            public void Save()
            {
                context.SaveChanges();
            }
    
            protected virtual void Dispose(bool disposing)
            {
                if (!this.disposed)
                    if (disposing)
                        context.Dispose();
                this.disposed = true;
            }
    
            public void Dispose()
            {
                Dispose(true);
                GC.SuppressFinalize(this);
            }
    		  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.TaxFigure GetTaxFigureWithCustomer(int TaxFigureID) 
    				{
    				try
    				{
    				return context.TaxFigure.Include("Customer").SingleOrDefault(x=>x.TaxFigureID == TaxFigureID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  			   
    			    
    		//*****************************************************************************************
    		//***************************Methods By Related Entities***********************************
    		//*****************************************************************************************
    				public SilkeyERP.Model.TaxFigure GetTaxFigureWithTax(int TaxFigureID) 
    				{
    				try
    				{
    				return context.TaxFigure.Include("Tax").SingleOrDefault(x=>x.TaxFigureID == TaxFigureID);  
    					}
    		catch
    		{
    		RejectChanges(context);
    		throw;
    		}		
    				}
    
    			  	
    }
}

//*****************************************************************************************
//********************************Interface Section****************************************
//*****************************************************************************************
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IAddressRepository:NAGFwk.Model.IBaseRepository<Model.Address>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Address GetAddressWithAllChilds(int AddressID);
    
    			
             SilkeyERP.Model.Address GetAddress(int AddressID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Address GetAddressWithBank(int AddressID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Address GetAddressWithCustomer(int AddressID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Address GetAddressWithSalesPerson(int AddressID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Address GetAddressWithSuppliers(int AddressID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IBankRepository:NAGFwk.Model.IBaseRepository<Model.Bank>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Bank GetBankWithAllChilds(int BankID);
    
    			
             SilkeyERP.Model.Bank GetBank(int BankID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Bank GetBankWithCity(int BankID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Bank GetBankWithBankAccounts(int BankID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Bank GetBankWithAddress(int BankID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Bank GetBankWithEmail(int BankID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Bank GetBankWithPhones(int BankID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IBankAccountsRepository:NAGFwk.Model.IBaseRepository<Model.BankAccounts>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.BankAccounts GetBankAccountsWithAllChilds(int BankAccountsID);
    
    			
             SilkeyERP.Model.BankAccounts GetBankAccounts(int BankAccountsID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.BankAccounts GetBankAccountsWithBank(int BankAccountsID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.BankAccounts GetBankAccountsWithChecks(int BankAccountsID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IBuyPriceListRepository:NAGFwk.Model.IBaseRepository<Model.BuyPriceList>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.BuyPriceList GetBuyPriceListWithAllChilds(int BuyPriceListID);
    
    			
             SilkeyERP.Model.BuyPriceList GetBuyPriceList(int BuyPriceListID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.BuyPriceList GetBuyPriceListWithSuppliers(int BuyPriceListID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.BuyPriceList GetBuyPriceListWithBuyPriceListDetails(int BuyPriceListID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.BuyPriceList GetBuyPriceListWithSuppliers1(int BuyPriceListID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IBuyPriceListDetailsRepository:NAGFwk.Model.IBaseRepository<Model.BuyPriceListDetails>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.BuyPriceListDetails GetBuyPriceListDetailsWithAllChilds(int BuyPriceListDetailsID);
    
    			
             SilkeyERP.Model.BuyPriceListDetails GetBuyPriceListDetails(int BuyPriceListDetailsID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.BuyPriceListDetails GetBuyPriceListDetailsWithBuyPriceList(int BuyPriceListDetailsID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.BuyPriceListDetails GetBuyPriceListDetailsWithProducts(int BuyPriceListDetailsID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.BuyPriceListDetails GetBuyPriceListDetailsWithTax(int BuyPriceListDetailsID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IChecksRepository:NAGFwk.Model.IBaseRepository<Model.Checks>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Checks GetChecksWithAllChilds(int CheckID);
    
    			
             SilkeyERP.Model.Checks GetChecks(int CheckID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Checks GetChecksWithBankAccounts(int CheckID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Checks GetChecksWithGeneralPaymentSupplier(int CheckID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ICityRepository:NAGFwk.Model.IBaseRepository<Model.City>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.City GetCityWithAllChilds(int CityID);
    
    			
             SilkeyERP.Model.City GetCity(int CityID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.City GetCityWithBank(int CityID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.City GetCityWithProvince(int CityID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.City GetCityWithCustomer(int CityID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.City GetCityWithSalesPerson(int CityID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ICountryRepository:NAGFwk.Model.IBaseRepository<Model.Country>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Country GetCountryWithAllChilds(int CountryID);
    
    			
             SilkeyERP.Model.Country GetCountry(int CountryID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Country GetCountryWithProvince(int CountryID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ICurrencyRepository:NAGFwk.Model.IBaseRepository<Model.Currency>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Currency GetCurrencyWithAllChilds(int CurrencyID);
    
    			
             SilkeyERP.Model.Currency GetCurrency(int CurrencyID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Currency GetCurrencyWithCurrencyConversion(int CurrencyID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Currency GetCurrencyWithCurrencyConversion1(int CurrencyID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Currency GetCurrencyWithPaymentMethod(int CurrencyID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ICurrencyConversionRepository:NAGFwk.Model.IBaseRepository<Model.CurrencyConversion>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.CurrencyConversion GetCurrencyConversionWithAllChilds(int ConversionID);
    
    			
             SilkeyERP.Model.CurrencyConversion GetCurrencyConversion(int ConversionID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.CurrencyConversion GetCurrencyConversionWithCurrency(int ConversionID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.CurrencyConversion GetCurrencyConversionWithCurrency1(int ConversionID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ICustomerRepository:NAGFwk.Model.IBaseRepository<Model.Customer>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Customer GetCustomerWithAllChilds(int CustomerID);
    
    			
             SilkeyERP.Model.Customer GetCustomer(int CustomerID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithCity(int CustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithPaymentMethod(int CustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithSales(int CustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithSalesPriceListByCustomer(int CustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithCustomerType(int CustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithSalesPriceList(int CustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithSalesPerson(int CustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithTaxFigure(int CustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithAddress(int CustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithEmail(int CustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Customer GetCustomerWithPhones(int CustomerID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ICustomerTypeRepository:NAGFwk.Model.IBaseRepository<Model.CustomerType>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.CustomerType GetCustomerTypeWithAllChilds(int CustomerTypeID);
    
    			
             SilkeyERP.Model.CustomerType GetCustomerType(int CustomerTypeID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.CustomerType GetCustomerTypeWithCustomer(int CustomerTypeID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IDailyCashRepository:NAGFwk.Model.IBaseRepository<Model.DailyCash>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.DailyCash GetDailyCashWithAllChilds(int DailyCashID);
    
    			
             SilkeyERP.Model.DailyCash GetDailyCash(int DailyCashID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.DailyCash GetDailyCashWithDailyCashDetails(int DailyCashID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IDailyCashDetailsRepository:NAGFwk.Model.IBaseRepository<Model.DailyCashDetails>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.DailyCashDetails GetDailyCashDetailsWithAllChilds(int DailyCashDetailsID);
    
    			
             SilkeyERP.Model.DailyCashDetails GetDailyCashDetails(int DailyCashDetailsID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.DailyCashDetails GetDailyCashDetailsWithDailyCash(int DailyCashDetailsID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.DailyCashDetails GetDailyCashDetailsWithPaymentMethod(int DailyCashDetailsID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IEmailRepository:NAGFwk.Model.IBaseRepository<Model.Email>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Email GetEmailWithAllChilds(int EmailID);
    
    			
             SilkeyERP.Model.Email GetEmail(int EmailID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Email GetEmailWithBank(int EmailID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Email GetEmailWithCustomer(int EmailID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Email GetEmailWithSalesPerson(int EmailID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Email GetEmailWithSuppliers(int EmailID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IGeneralPaymentSupplierRepository:NAGFwk.Model.IBaseRepository<Model.GeneralPaymentSupplier>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.GeneralPaymentSupplier GetGeneralPaymentSupplierWithAllChilds(int GeneralPaymentSupplierID);
    
    			
             SilkeyERP.Model.GeneralPaymentSupplier GetGeneralPaymentSupplier(int GeneralPaymentSupplierID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.GeneralPaymentSupplier GetGeneralPaymentSupplierWithChecks(int GeneralPaymentSupplierID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.GeneralPaymentSupplier GetGeneralPaymentSupplierWithPaymentMethod(int GeneralPaymentSupplierID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.GeneralPaymentSupplier GetGeneralPaymentSupplierWithPaymentSupplier(int GeneralPaymentSupplierID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IPaymentMethodRepository:NAGFwk.Model.IBaseRepository<Model.PaymentMethod>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.PaymentMethod GetPaymentMethodWithAllChilds(int PaymentMethodID);
    
    			
             SilkeyERP.Model.PaymentMethod GetPaymentMethod(int PaymentMethodID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentMethod GetPaymentMethodWithCurrency(int PaymentMethodID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentMethod GetPaymentMethodWithCustomer(int PaymentMethodID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentMethod GetPaymentMethodWithDailyCashDetails(int PaymentMethodID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentMethod GetPaymentMethodWithGeneralPaymentSupplier(int PaymentMethodID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentMethod GetPaymentMethodWithPaymentMethodDetails(int PaymentMethodID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IPaymentMethodDetailsRepository:NAGFwk.Model.IBaseRepository<Model.PaymentMethodDetails>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.PaymentMethodDetails GetPaymentMethodDetailsWithAllChilds(int PaymentMethodDetailsID);
    
    			
             SilkeyERP.Model.PaymentMethodDetails GetPaymentMethodDetails(int PaymentMethodDetailsID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentMethodDetails GetPaymentMethodDetailsWithPaymentMethod(int PaymentMethodDetailsID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IPaymentSupplierRepository:NAGFwk.Model.IBaseRepository<Model.PaymentSupplier>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.PaymentSupplier GetPaymentSupplierWithAllChilds(int PaymentSupplierID);
    
    			
             SilkeyERP.Model.PaymentSupplier GetPaymentSupplier(int PaymentSupplierID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentSupplier GetPaymentSupplierWithGeneralPaymentSupplier(int PaymentSupplierID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentSupplier GetPaymentSupplierWithSuppliers(int PaymentSupplierID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentSupplier GetPaymentSupplierWithTax(int PaymentSupplierID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentSupplier GetPaymentSupplierWithPaymentSupplierDetails(int PaymentSupplierID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IPaymentSupplierDetailsRepository:NAGFwk.Model.IBaseRepository<Model.PaymentSupplierDetails>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.PaymentSupplierDetails GetPaymentSupplierDetailsWithAllChilds(int PaymentSupplierDetailsID);
    
    			
             SilkeyERP.Model.PaymentSupplierDetails GetPaymentSupplierDetails(int PaymentSupplierDetailsID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentSupplierDetails GetPaymentSupplierDetailsWithPaymentSupplier(int PaymentSupplierDetailsID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentSupplierDetails GetPaymentSupplierDetailsWithProducts(int PaymentSupplierDetailsID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.PaymentSupplierDetails GetPaymentSupplierDetailsWithTax(int PaymentSupplierDetailsID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IPhonesRepository:NAGFwk.Model.IBaseRepository<Model.Phones>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Phones GetPhonesWithAllChilds(int PhoneID);
    
    			
             SilkeyERP.Model.Phones GetPhones(int PhoneID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Phones GetPhonesWithBank(int PhoneID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Phones GetPhonesWithCustomer(int PhoneID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Phones GetPhonesWithSalesPerson(int PhoneID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Phones GetPhonesWithSuppliers(int PhoneID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IProductsRepository:NAGFwk.Model.IBaseRepository<Model.Products>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Products GetProductsWithAllChilds(int ProductID);
    
    			
             SilkeyERP.Model.Products GetProducts(int ProductID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Products GetProductsWithBuyPriceListDetails(int ProductID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Products GetProductsWithPaymentSupplierDetails(int ProductID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Products GetProductsWithSalesPriceListDetails(int ProductID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Products GetProductsWithSalesDetails(int ProductID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Products GetProductsWithSalesPriceListByCustomer(int ProductID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface IProvinceRepository:NAGFwk.Model.IBaseRepository<Model.Province>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Province GetProvinceWithAllChilds(int ProvinceID);
    
    			
             SilkeyERP.Model.Province GetProvince(int ProvinceID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Province GetProvinceWithCity(int ProvinceID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Province GetProvinceWithCountry(int ProvinceID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ISalesRepository:NAGFwk.Model.IBaseRepository<Model.Sales>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Sales GetSalesWithAllChilds(int SalesID);
    
    			
             SilkeyERP.Model.Sales GetSales(int SalesID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Sales GetSalesWithCustomer(int SalesID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Sales GetSalesWithSalesPerson(int SalesID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Sales GetSalesWithSalesPriceList(int SalesID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Sales GetSalesWithSalesStatus(int SalesID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Sales GetSalesWithTax(int SalesID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Sales GetSalesWithSalesDetails(int SalesID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ISalesDetailsRepository:NAGFwk.Model.IBaseRepository<Model.SalesDetails>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.SalesDetails GetSalesDetailsWithAllChilds(int SalesDetailsID);
    
    			
             SilkeyERP.Model.SalesDetails GetSalesDetails(int SalesDetailsID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesDetails GetSalesDetailsWithProducts(int SalesDetailsID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesDetails GetSalesDetailsWithSales(int SalesDetailsID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesDetails GetSalesDetailsWithTax(int SalesDetailsID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ISalesPersonRepository:NAGFwk.Model.IBaseRepository<Model.SalesPerson>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.SalesPerson GetSalesPersonWithAllChilds(int SalesPersonID);
    
    			
             SilkeyERP.Model.SalesPerson GetSalesPerson(int SalesPersonID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPerson GetSalesPersonWithCity(int SalesPersonID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPerson GetSalesPersonWithCustomer(int SalesPersonID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPerson GetSalesPersonWithSales(int SalesPersonID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPerson GetSalesPersonWithAddress(int SalesPersonID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPerson GetSalesPersonWithEmail(int SalesPersonID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPerson GetSalesPersonWithPhones(int SalesPersonID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPerson GetSalesPersonWithSalesPriceList(int SalesPersonID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ISalesPriceListRepository:NAGFwk.Model.IBaseRepository<Model.SalesPriceList>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.SalesPriceList GetSalesPriceListWithAllChilds(int SalesPriceListID);
    
    			
             SilkeyERP.Model.SalesPriceList GetSalesPriceList(int SalesPriceListID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPriceList GetSalesPriceListWithCustomer(int SalesPriceListID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPriceList GetSalesPriceListWithSales(int SalesPriceListID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPriceList GetSalesPriceListWithSalesPriceListDetails(int SalesPriceListID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPriceList GetSalesPriceListWithSalesPerson(int SalesPriceListID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ISalesPriceListByCustomerRepository:NAGFwk.Model.IBaseRepository<Model.SalesPriceListByCustomer>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.SalesPriceListByCustomer GetSalesPriceListByCustomerWithAllChilds(int SalesPriceListByCustomerID);
    
    			
             SilkeyERP.Model.SalesPriceListByCustomer GetSalesPriceListByCustomer(int SalesPriceListByCustomerID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPriceListByCustomer GetSalesPriceListByCustomerWithCustomer(int SalesPriceListByCustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPriceListByCustomer GetSalesPriceListByCustomerWithProducts(int SalesPriceListByCustomerID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPriceListByCustomer GetSalesPriceListByCustomerWithTax(int SalesPriceListByCustomerID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ISalesPriceListDetailsRepository:NAGFwk.Model.IBaseRepository<Model.SalesPriceListDetails>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.SalesPriceListDetails GetSalesPriceListDetailsWithAllChilds(int SalesPriceListDetailsID);
    
    			
             SilkeyERP.Model.SalesPriceListDetails GetSalesPriceListDetails(int SalesPriceListDetailsID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPriceListDetails GetSalesPriceListDetailsWithProducts(int SalesPriceListDetailsID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPriceListDetails GetSalesPriceListDetailsWithSalesPriceList(int SalesPriceListDetailsID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesPriceListDetails GetSalesPriceListDetailsWithTax(int SalesPriceListDetailsID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ISalesStatusRepository:NAGFwk.Model.IBaseRepository<Model.SalesStatus>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.SalesStatus GetSalesStatusWithAllChilds(int StatusID);
    
    			
             SilkeyERP.Model.SalesStatus GetSalesStatus(int StatusID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.SalesStatus GetSalesStatusWithSales(int StatusID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ISuppliersRepository:NAGFwk.Model.IBaseRepository<Model.Suppliers>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Suppliers GetSuppliersWithAllChilds(int SupplierID);
    
    			
             SilkeyERP.Model.Suppliers GetSuppliers(int SupplierID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Suppliers GetSuppliersWithBuyPriceList(int SupplierID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Suppliers GetSuppliersWithPaymentSupplier(int SupplierID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Suppliers GetSuppliersWithAddress(int SupplierID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Suppliers GetSuppliersWithEmail(int SupplierID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Suppliers GetSuppliersWithPhones(int SupplierID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Suppliers GetSuppliersWithBuyPriceList1(int SupplierID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ITaxRepository:NAGFwk.Model.IBaseRepository<Model.Tax>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.Tax GetTaxWithAllChilds(int TaxID);
    
    			
             SilkeyERP.Model.Tax GetTax(int TaxID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Tax GetTaxWithBuyPriceListDetails(int TaxID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Tax GetTaxWithPaymentSupplier(int TaxID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Tax GetTaxWithPaymentSupplierDetails(int TaxID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Tax GetTaxWithSales(int TaxID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Tax GetTaxWithSalesDetails(int TaxID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Tax GetTaxWithSalesPriceListByCustomer(int TaxID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Tax GetTaxWithSalesPriceListDetails(int TaxID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.Tax GetTaxWithTaxFigure(int TaxID) ;
    				
    			  }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial interface ITaxFigureRepository:NAGFwk.Model.IBaseRepository<Model.TaxFigure>
    {
    		
    		//*****************************************************************************************
    		//***************************Methods By Primary Key****************************************
    		//*****************************************************************************************
    		  SilkeyERP.Model.TaxFigure GetTaxFigureWithAllChilds(int TaxFigureID);
    
    			
             SilkeyERP.Model.TaxFigure GetTaxFigure(int TaxFigureID); 
    		  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.TaxFigure GetTaxFigureWithCustomer(int TaxFigureID) ;
    				
    			  			   
    			    
    	//*****************************************************************************************
    		//***************************Methods By Related Entities****************************************
    		//*****************************************************************************************
    				 SilkeyERP.Model.TaxFigure GetTaxFigureWithTax(int TaxFigureID) ;
    				
    			  }
}

//*****************************************************************************************
//********************************Functions Section****************************************
//*****************************************************************************************
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class GetSalesRepository:BaseManagerContext
    {
    private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		public GetSalesRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
     public IQueryable<GetSales_Result> GetSales(Nullable<System.DateTime> dateFrom, Nullable<System.DateTime> dateTo, Nullable<bool> isByHour)
    {
    return context.GetSales(dateFrom, dateTo, isByHour);
    }
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class GetSalesByChannelRepository:BaseManagerContext
    {
    private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		public GetSalesByChannelRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
     public IQueryable<GetSalesByChannel_Result> GetSalesByChannel(Nullable<System.DateTime> dateFrom, Nullable<System.DateTime> dateTo)
    {
    return context.GetSalesByChannel(dateFrom, dateTo);
    }
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class GetSalesByProductRepository:BaseManagerContext
    {
    private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		public GetSalesByProductRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
     public IQueryable<GetSalesByProduct_Result> GetSalesByProduct(Nullable<System.DateTime> dateFrom, Nullable<System.DateTime> dateTo)
    {
    return context.GetSalesByProduct(dateFrom, dateTo);
    }
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class GetSalesByRegionRepository:BaseManagerContext
    {
    private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		public GetSalesByRegionRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
     public IQueryable<GetSalesByRegion_Result> GetSalesByRegion(Nullable<System.DateTime> dateFrom, Nullable<System.DateTime> dateTo)
    {
    return context.GetSalesByRegion(dateFrom, dateTo);
    }
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class GetSalesBySectorRepository:BaseManagerContext
    {
    private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		public GetSalesBySectorRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
     public IQueryable<GetSalesBySector_Result> GetSalesBySector(Nullable<System.DateTime> dateFrom, Nullable<System.DateTime> dateTo)
    {
    return context.GetSalesBySector(dateFrom, dateTo);
    }
    }
}
namespace SilkeyERP.Model
{
    using System;
    using System.Collections.Generic; 
    using SilkeyERP.Model;
    using System.Linq;
    using System.Text;
    using System.Data.Entity;
    using System.Threading.Tasks;
    using NAGFwk.Model;
    
    public partial class GetTotalSalesByRangeRepository:BaseManagerContext
    {
    private bool disposed = false;
            private Model.SilkeyERPEntities context;
    
    		public GetTotalSalesByRangeRepository()
            {
                if (this.context == null)
                    this.context = BaseObjectContext<Model.SilkeyERPEntities>.Instance.context;
            }
     public IQueryable<GetTotalSalesByRange_Result> GetTotalSalesByRange(Nullable<System.DateTime> dateFrom, Nullable<System.DateTime> dateTo)
    {
    return context.GetTotalSalesByRange(dateFrom, dateTo);
    }
    }
}
          
